<!doctype html>
<html>
<head>
    <meta charset=utf-8>
    <title></title>
    <meta name="robots" content="noindex,nofollow">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<?=Web_Path?>packs/layui/css/layui.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/font.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/style.css">
    <script src="<?=Web_Path?>packs/js/jquery.min.js"></script>
    <script src="<?=Web_Path?>packs/layui/layui.js"></script>
</head>
<body>
    <span class="layui-breadcrumb" >
        <a ><cite><i class="fa fa-map-marker"></i><?=L('tpl_l_01')?></cite></a>
        <a href="<?=site_url('opt/main')?>"><?=L('tpl_l_02')?></a>
        <a href="<?=site_url('links')?>"><?=L('tpl_l_03')?></a>
    </span>
    <form class="layui-form layui-form-so" action="<?=site_url('links')?>" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label"><?=L('tpl_l_04')?></label>
            <div class="layui-input-inline">
                <input type="text" name="key" value="<?=$key?>" class="layui-input">
            </div>
            <label class="layui-form-label"><?=L('tpl_l_05')?></label>
            <div class="layui-input-inline">
                <select name="cid">
                    <option value="0"><?=L('tpl_l_06')?></option>
                    <option <?php if($cid==1){echo 'selected';}?> value="1"><?=L('tpl_l_07')?></option>
                    <option <?php if($cid==2){echo 'selected';}?> value="2"><?=L('tpl_l_08')?></option>
                </select>
            </div>
            <label class="layui-form-label"><?=L('tpl_l_09')?></label>
            <div class="layui-input-inline">
                <select name="sid">
                    <option value="0"><?=L('tpl_l_06')?></option>
                    <option <?php if($sid==1){echo 'selected';}?> value="1"><?=L('tpl_l_10')?></option>
                    <option <?php if($sid==2){echo 'selected';}?> value="2"><?=L('tpl_l_11')?></option>
                </select>
            </div>
             <div class="layui-input-inline">
                <button class="layui-btn" type="submit"><?=L('tpl_l_12')?></button>
            </div>
        </div>
    </form>
    <form class="layui-form" action="<?=site_url('links/del')?>" method="post">
        <table class="layui-table" style="width: 99.7%">
            <colgroup>
                <col width="40">
                <col>
                <col>
                <col>
                <col>
                <col width="60">
            </colgroup>
            <thead>
                <tr>
                    <th><?=L('tpl_l_13')?></th>
                    <th class="phide"><?=L('tpl_l_14')?></th>
                    <th class="phide"><?=L('tpl_l_15')?></th>
                    <th><?=L('tpl_l_16')?></th>
                    <th class="phide"><?=L('tpl_l_17')?></th>
                    <th><?=L('tpl_l_18')?></th>
                    <th><?=L('tpl_l_19')?></th>
                    <th><?=L('tpl_l_20')?></th>
                </tr>
            </thead>
            <tbody>
            <?php
                if(empty($links)) echo '<tr><td align="center" height="50" colspan="8">'.L('tpl_20').'</td></tr>';
                foreach ($links as $row) {
                    $logo=($row->cid==2)?'<img class="change" onclick="cscms.get_open(\''.piclink('links',$row->pic).'\',\''.$row->name.'\',\'50%\',\'85%\')" height="30" src="'.piclink('links',$row->pic).'">':'-';
                    $zhuye=($row->sid==1)?'<i class="fa fa-check colorl" ></i>':'<i class="fa fa-close " style="color: red" ></i>';
                    $cls = ($row->cid==1)?'<span class="layui-btn layui-btn-mini">'.L('tpl_l_07').'</span>':'<span class="layui-btn layui-btn-danger layui-btn-mini">'.L('tpl_l_08').'</span>';
                    echo '
                    <tr id="row_'.$row->id.'">
                        <td><input name="id['.$row->id.']" class="xuan" type="checkbox" value="'.$row->id.'" /></td>
                        <td class="phide">'.$row->id.'</td>
                        <td class="imgtd phide" >'.$logo.'</td>
                        <td >'.$row->name.'</td>
                        <td class="phide"><a href="'.$row->url.'" target="links">'.$row->url.'</a></td>
                        <td>'.$cls.'</td>
                        <td style="text-align: center;cursor: pointer;" id="zy_'.$row->id.'" onclick="cscms.ok_no(\''.site_url('links/init').'\','.$row->id.','.$row->sid.',\'zy_\')">'.$zhuye.'</td>
                        <td class="basedb-more">
                            <a class="layui-btn layui-btn-mini" href="javascript:cscms.get_open(\''.site_url('links/edit').'?id='.$row->id.'\',\''.L('tpl_l_21').'\',\'500px\',\'400px\');">'.L('tpl_l_22').'</a><a class="layui-btn layui-btn-mini layui-btn-danger" href="javascript:cscms.del_one(\''.site_url('links/del').'\','.$row->id.');">'.L('tpl_l_23').'</a>
                        </td>
                    </tr> ';
                }
            ?>
            </tbody>
        </table>
        <div class="more_func">
            <a class="layui-btn layui-btn-primary layui-btn-small" href="javascript:cscms.select_all();"><i class="fa fa-check colorl" ></i><?=L('tpl_l_24')?></a><a class="layui-btn layui-btn-primary layui-btn-small" lay-submit lay-filter="del_pl"><i class="fa fa-close " style="color: red" ></i><?=L('tpl_l_25')?></a><a class="layui-btn layui-btn-primary layui-btn-small" href="javascript:cscms.get_open('<?=site_url('links/add')?>','<?=L('tpl_l_26')?>','500px','400px');"><i class="fa fa-plus" style="color: #1E9FFF" ></i><?=L('tpl_l_26')?></a>
        </div>
    </form>
    <div id="page">
        <div class="data_nums phide"><?=$page_data?></div>
        <div class="data_page"><?=$page_list?></div>
    </div>
<script src="<?=Web_Path?>packs/admin/js/cscms.js"></script>
<script>
cscms.init();
</script>
</body>
</html>
